package com.right.service.impl;



import java.util.List;

import com.Tools.PageData;
import com.right.dao.CommentDao;
import com.right.dao.impl.CommentDaoImp;
import com.right.entity.Comment;
import com.right.service.CommentService;


public class CommentServiceImpl implements CommentService {
	CommentDao cd=new CommentDaoImp();
	@Override
public boolean addcomment(Comment comment) {
		if(comment==null) {
			return false;
		}
		return cd.addcomment(comment);
	}
@Override
public boolean delcomment(int commentid) {
	if(commentid<=0) {
		return false;
	}
	return cd.delcomment(commentid);
}
@Override
public PageData<Comment> getCommentByPage(int page, int pageSize, String keywords) {
	if(page<0) {
		page=1;
	}
	return  cd.getCommentByPage(page, pageSize, keywords);
}
@Override
public List<Comment> getComments(String keywords) {
	
	return cd.getComments(keywords);
}
@Override
public boolean updatecomment(Comment comment) {
	if(comment==null) {
		return false;
	}
	return cd.updatecomment(comment);
}

}
